package com.faceye.test.core.repository;

import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

import com.faceye.core.entity.Sequence;
import com.faceye.core.repository.mongo.SequenceRepository;

import org.junit.Assert;

public class SequenceRepositoryTestCase extends BaseRepositoryTestCase {
	@Autowired
	private SequenceRepository sequenceRepository;
	
	@Test
	public void testGetSequenceByName() throws Exception{
		
		String name="com.faceye.component.book.doc.Book";
		Sequence seq=new Sequence();
		seq.setId(System.currentTimeMillis());
		seq.setName(name);
		seq.setSeq(1L);
		seq.setStep(1L);
		this.sequenceRepository.save(seq);
		Sequence sequence=this.sequenceRepository.getSequenceByName(name);
		Assert.assertTrue(sequence!=null);
	}

}
